import argparse

from srun import Srun


def main():
    parser = argparse.ArgumentParser(description='Srun Client')
    parser.add_argument('-u', '--username', help='Username', required=True)
    parser.add_argument('-p', '--password', help='Password', required=True)
    parser.add_argument('-l', '--logout', help='Logout', action='store_true')
    args = parser.parse_args()

    srun = Srun()
    srun.setuser(args.username, args.password)
    srun.get_config()

    if args.logout:
        srun.logout()
    else:
        srun.login()


if __name__ == '__main__':
    main()
